home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / ieee_exponent.z / ieee_exponent
Encoding:
Text File  |  1998-10-30  |  4.8 KB  |  123 lines

  1. IEEE_EXPONENT(3I)                                      Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      IIEEEEEE__EEXXPPOONNEENNTT - Returns the unbiased exponent of _x
  6.  
  7. SSYYNNOOPPSSIISS
  8.      IIEEEEEE__EEXXPPOONNEENNTT (([XX==]_x[,, [YY==]_y]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS/mk and IRIX systems
  12.  
  13.      CRAY T90 systems that support IEEE floating-point arithmetic
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
  17.  
  18.      IEEE Standard for Binary Floating-point Arithmetic
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      The IIEEEEEE__EEXXPPOONNEENNTT intrinsic function returns the unbiased exponent of
  22.      _x.  This function corresponds to the llooggbb function described in the
  23.      IEEE standard appendix of recommended functions.
  24.  
  25.      The IIEEEEEE__EEXXPPOONNEENNTT function accepts the following arguments:
  26.  
  27.      _x         Must be of type real.  Can be a scalar or array value.
  28.  
  29.      _y         Can be of type integer or real.  Must be a scalar value.
  30.  
  31.      IIEEEEEE__EEXXPPOONNEENNTT is an elemental function.  The name of this intrinsic
  32.      cannot be passed as an argument.
  33.  
  34. RREESSUULLTT TTYYPPEE AANNDD TTYYPPEE PPAARRAAMMEETTEERR
  35.      If _x is a scalar, the result is a scalar.  If _x is an array, the
  36.      result is an array of the same shape as _x.
  37.  
  38.      If _y is absent, the result is of type default integer.
  39.  
  40.      If _y is present and is of type integer, the result is of type integer
  41.      and has the same kind type parameter value as _y.
  42.  
  43.      If _y is present and is of type real, the result is of type real and
  44.      has the same kind type parameter value as _y.
  45.  
  46. NNOOTTEESS
  47.      The IEEE intrinsic procedures use the named constants contained in a
  48.      system module, so you must include one of the following statements in
  49.      your program:
  50.  
  51.      * On UNICOS and UNICOS/mk systems:  UUSSEE CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
  52.  
  53.      * On UNICOS, UNICOS/mk, and IRIX systems:  UUSSEE FFTTNN__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
  54.  
  55.      The CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS module is obsolescent.  It will be removed
  56.      for the CF90 4.0 release.
  57.  
  58. RREETTUURRNN VVAALLUUEESS
  59.      The result is the value of the unbiased exponent of _x.
  60.  
  61.      If _y is absent and _x is +_i_n_f, -_i_n_f, or NaN, the result is HHUUGGEE((00)).  If
  62.      _x is 0.0, the result is --HHUUGGEE((00)).
  63.  
  64.      If _y is present and of type integer and _x is +_i_n_f, -_i_n_f, or NaN, the
  65.      result is HHUUGGEE((_y)).  If _x is 0.0, the result is --HHUUGGEE((_y)).
  66.  
  67.      If _y is present and of type real, the value is an integral value in
  68.      floating-point format.  If _x is a NaN, the result is a NaN.  If _x is
  69.      +_i_n_f or -_i_n_f, the result is +_i_n_f.  If _x is 0.0, the result is -_i_n_f and
  70.      the division by zero exception is raised.
  71.  
  72.      When _x is positive and finite, the expression IIEEEEEE__BBIINNAARRYY__SSCCAALLEE((XX,,
  73.      --IIEEEEEE__EEXXPPOONNEENNTT((XX)))) lies strictly between 0 and 2; it is less than 1
  74.      only when _x is denormalized.
  75.  
  76. EEXXAAMMPPLLEESS
  77.      Example 1.
  78.  
  79.           REAL   x
  80.           ...                 ! Compute X.
  81.           PRINT *, "Unbiased exponent of X:", IEEE_EXPONENT(x)
  82.  
  83.      The PPRRIINNTT statement prints the unbiased exponent of _x as a default
  84.      integer value as long as _x is not one of the exceptional values noted
  85.      in the RETURN VALUES section.
  86.  
  87.      Example 2.  Program iieeeexxpp..ff9900 uses several intrinsic procedures:
  88.  
  89.                 REAL(8) X
  90.  
  91.                 PRINT *," TEST EXPONENT and IEEE_EXPONENT of HUGE"
  92.                 X = HUGE(1.0_8)
  93.  
  94.           ! HUGE scaled to 0.xxx
  95.                 PRINT *," F90 EXPONENT of x=",EXPONENT(x)
  96.  
  97.           ! HUGE scaled to x.xx
  98.                 PRINT *," Unbiased IEEE_EXPONENT of x=",IEEE_EXPONENT(x)
  99.  
  100.                 PRINT *," TEST EXPONENT and IEEE_EXPONENT of TINY"
  101.                 X = TINY(1.0_8)
  102.  
  103.           ! TINY scaled to 0.xxx
  104.                 PRINT *," F90 EXPONENT of x=",EXPONENT(x)
  105.  
  106.           ! TINY scaled to x.xx
  107.                 PRINT *," Unbiased IEEE_EXPONENT of x=",IEEE_EXPONENT(x)
  108.                 END
  109.  
  110.      The output from this program is as follows:
  111.  
  112.             TEST EXPONENT and IEEE_EXPONENT of HUGE
  113.             F90 EXPONENT of x= 1024
  114.             Unbiased IEEE_EXPONENT of x= 1023
  115.             TEST EXPONENT and IEEE_EXPONENT of TINY
  116.             F90 EXPONENT of x= -1021
  117.             Unbiased IEEE_EXPONENT of x= -1022
  118.  
  119. SSEEEE AALLSSOO
  120.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  121.      printed version of this man page.
  122.  
  123.